<?php
/**
 * Created by PhpStorm.
 * User: lzh 9157374
 * Date: 2018/7/1
 * Time: 下午2:45
 */

if(!function_exists('gWebUrl')){
    function gWebUrl($do,$query = [])
    {
        return \Core\common\Assist::gWebUrl($do,$query);
    }
}
if(!function_exists('gMobileUrl')){
    function gMobileUrl($do,$query = [])
    {
        return \Core\common\Assist::gMobileUrl($do,$query);
    }
}
//查数据库
if(!function_exists('M')){
    function M($table,$status=true){
        return \Core\common\Model::table($table,$status);
    }
}
//获取数据
if(!function_exists('I')){
    function I($key,$default = ''){
        return \Core\common\Assist::gpcVal($key,$default);
    }
}

if(!function_exists('uniacid')){
    function uniacid(){
        return \Core\common\Assist::uniacid();
    }
}


if(!function_exists('create_info')){
    function create_info($message,$redirect,$sign){
        $message = [
            'message'=>$message,
            'redirect'=>$redirect,
            'type'=> strtolower($sign),
        ];
        return \Core\common\Response::json($message);
    }
}


if(!function_exists('courier_number')){
    function courier_number($com = ''){
        $data = [
            ['com_name'=>'顺丰速运','com'=>'shunfeng'],
            ['com_name'=>'百世快递','com'=>'huitongkuaidi'],
            ['com_name'=>'中通快递','com'=>'zhongtong'],
            ['com_name'=>'申通快递','com'=>'shentong'],
            ['com_name'=>'圆通速递','com'=>'yuantong'],
            ['com_name'=>'韵达速递','com'=>'yunda'],
            ['com_name'=>'邮政快递包裹','com'=>'youzhengguonei'],
            ['com_name'=>'EMS','com'=>'ems'],
            ['com_name'=>'天天快递','com'=>'tiantian'],
            ['com_name'=>'京东快递','com'=>'jd'],
            ['com_name'=>'优速快递','com'=>'youshuwuliu'],
            ['com_name'=>'德邦快递','com'=>'debangkuaidi'],
            ['com_name'=>'宅急送','com'=>'zhaijisong'],
            ['com_name'=>'中通快运','com'=>'zhongtongkuaiyun'],
            ['com_name'=>'韵达快运','com'=>'yundakuaiyun'],
            ['com_name'=>'圆通快运','com'=>'yuantongkuaiyun'],
            ['com_name'=>'百世快运','com'=>'baishiwuliu'],
        ];
        if($com){
            foreach ($data as $k=>$v){
                if($v['com'] == $com){
                    return $v['com_name'];
                }
            }
        }
        return $data;
    }
}




